How to pass dynamic information between a form and a service? [closed]
Posted
by
qminator
on Programmers
See other posts from Programmers
or by qminator
Published on 2012-12-04T15:09:39Z
Indexed on
2012/12/04
17:19 UTC
Read the original article
Hit count: 203
I have a design problem and hopefully the braintrust which is stack exchange can help.
I have a generic form, which loads a dataset and displays it. It never has direct knowledge of what it contains but can pass it to a service for manipulation (via an Onclick event for example). However, the form might need to alter its behaviour based on the manipulation by the service. Example: The service realises this dataset requires sending of an email by the user and needs to send an instruction to the form to open up a mail form.
My idea is thus:
I'm thinking about passing back some type of key/name dictionary, filled with commands which the service requires. They could then be interpeted by the form without it need to reference something specific.
Example: IF the service decides that the dataset needs to refresh it would send back a key/name pair, I might even be able to chain commands. Refreshing the dataset and sending a mail.
Refresh / "Foo" Mail / "[email protected]"
The form would reference an action explicitly (Refresh or Mail) but not the instructions themselves.
Is this a valid idea or am I wasting time?
© Programmers or respective owner